Перейти к основному содержимому

Reset Password API

POST /resetPassword

Description

This API endpoint allows users to reset their password using a token provided in the password reset email. The user must supply the reset token and their new desired password.

Request Body

The request utilizes GraphQL to perform the resetPassword mutation.

Mutation:

mutation resetPassword ($token: String!, $password: String!) {
resetPassword (token: $token, password: $password)
}

Variables:

{
"token": "<Reset_Token>",
"password": "<New_Password>"
}
  • token (String): The reset token that was sent to the user's email address.
  • password (String): The new password that the user wishes to set for their account.

Response:

  • Success (200 OK):

    • If the password reset is successful, no additional data is returned, and the user's password will be updated.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid token, expired token, weak password, or server errors.

Note:

Ensure that the reset token is the one received via email and is used before it expires. The new password should meet the security requirements of the platform (e.g., minimum length, complexity).